package com.ruowei.modules.sys.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;

/**
 * 系统配置表
 */
@ApiModel(description = "系统配置表")
@Entity
@Table(name = "sys_config")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SysConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 设置键值
     */
    @ApiModelProperty(value = "设置键值")
    @Column(name = "config_key")
    private String configKey;

    /**
     * 设置名称
     */
    @ApiModelProperty(value = "设置名称")
    @Column(name = "config_name")
    private String configName;

    /**
     * 设置数值
     */
    @Size(max = 1000)
    @ApiModelProperty(value = "设置数值")
    @Column(name = "config_value", length = 1000)
    private String configValue;

    /**
     * 备注
     */
    @Size(max = 2000)
    @ApiModelProperty(value = "备注")
    @Column(name = "remark", length = 2000)
    private String remark;

    /**
     * 设置时间
     */
    @ApiModelProperty(value = "设置时间")
    @Column(name = "set_date")
    private Instant setDate;

    /**
     * 设置人
     */
    @ApiModelProperty(value = "设置人")
    @Column(name = "setter")
    private String setter;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getConfigKey() {
        return configKey;
    }

    public SysConfig configKey(String configKey) {
        this.configKey = configKey;
        return this;
    }

    public void setConfigKey(String configKey) {
        this.configKey = configKey;
    }

    public String getConfigName() {
        return configName;
    }

    public SysConfig configName(String configName) {
        this.configName = configName;
        return this;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public String getConfigValue() {
        return configValue;
    }

    public SysConfig configValue(String configValue) {
        this.configValue = configValue;
        return this;
    }

    public void setConfigValue(String configValue) {
        this.configValue = configValue;
    }

    public String getRemark() {
        return remark;
    }

    public SysConfig remark(String remark) {
        this.remark = remark;
        return this;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Instant getSetDate() {
        return setDate;
    }

    public SysConfig setDate(Instant setDate) {
        this.setDate = setDate;
        return this;
    }

    public void setSetDate(Instant setDate) {
        this.setDate = setDate;
    }

    public String getSetter() {
        return setter;
    }

    public SysConfig setter(String setter) {
        this.setter = setter;
        return this;
    }

    public void setSetter(String setter) {
        this.setter = setter;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof SysConfig)) {
            return false;
        }
        return id != null && id.equals(((SysConfig) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "SysConfig{" +
            "id=" + getId() +
            ", configKey='" + getConfigKey() + "'" +
            ", configName='" + getConfigName() + "'" +
            ", configValue='" + getConfigValue() + "'" +
            ", remark='" + getRemark() + "'" +
            ", setDate='" + getSetDate() + "'" +
            ", setter='" + getSetter() + "'" +
            "}";
    }
}
